﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Security;

namespace OA.UI.MVC.Controllers
{
    [Authorize]
    public class HomeController : Controller
    {

        //[Authorize(Users ="admin",Roles ="超级管理员")]
        public ActionResult Index()
        {

            ViewBag.User = this.User.Identity.Name;

            HttpCookie authCookie = Request.Cookies[FormsAuthentication.FormsCookieName];
            
            FormsAuthenticationTicket authTicket = FormsAuthentication.Decrypt(authCookie.Value);
            ViewBag.UserData= authTicket.UserData;
           
            return View();
        }
        //[AllowAnonymous]
        public ActionResult About()
        {
            ViewBag.Message = "Your application description page.";

            return View();
        }

        //[AllowAnonymous]
        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }
    }
}